Skip to content

fix: nix build and nix check in CI #6274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

aldur
Copy link
Collaborator

@aldur aldur commented Jul 10, 2025

Description

This PR fixes nix builds, broken since 826c7cc, by adding the corresponding path to the fileset.

In addition, it adds a CI check for Nix builds.

@aldur aldur requested review from a team as code owners July 10, 2025 08:05
@aldur aldur changed the title Fix: nix build and CI fix: nix build and CI Jul 10, 2025
@aldur aldur requested review from Jiloc and wileyj July 10, 2025 08:38
@aldur aldur moved this to Status: In Review in Stacks Core Eng Jul 10, 2025
@aldur aldur added this to the 3.1.0.0.14 milestone Jul 10, 2025
@aldur aldur self-assigned this Jul 10, 2025
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.04%. Comparing base (d4980dd) to head (5fafb8f).
Report is 48 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6274      +/-   ##
===========================================
+ Coverage    81.96%   82.04%   +0.08%     
===========================================
  Files          543      543              
  Lines       345677   345677              
  Branches       323      323              
===========================================
+ Hits        283332   283626     +294     
+ Misses       62337    62043     -294     
  Partials         8        8              

see 50 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4980dd...5fafb8f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wileyj
Copy link
Collaborator

wileyj commented Jul 10, 2025

The changes seem fine, but the question to ask is - should we be running this job on every PR/commit? it's an expensive job to run indicated by the timing (22m of runtime), and that was part of the reason we removed the docker image build on each PR/commit (deferring to run it manually when needed).

leaving it as-is isn't a bad thing either - i just see it as a tradeoff: we may find that PR's take longer to merge, and will have to possibly ignore failures when this job takes longer than usual (the other reason we stopped running the docker image build in PR's).

@aldur
Copy link
Collaborator Author

aldur commented Jul 11, 2025

The changes seem fine, but the question to ask is - should we be running this job on every PR/commit? it's an expensive job to run indicated by the timing (22m of runtime), and that was part of the reason we removed the docker image build on each PR/commit (deferring to run it manually when needed).

leaving it as-is isn't a bad thing either - i just see it as a tradeoff: we may find that PR's take longer to merge, and will have to possibly ignore failures when this job takes longer than usual (the other reason we stopped running the docker image build in PR's).

Fair points! I have just re-run the CI after merging develop, let's see if the runtime improves since it should cache some of the outputs. If that doesn't, I think it is OK to treat this the same as Docker builds.

@Jiloc
Copy link
Contributor

Jiloc commented Jul 11, 2025

Unfortunately it's still in the 20 minutes range. I am not sure if we want to explore it, (I could try it out myself when I merge my current work), but there could be a chance to maybe improve this by a lot with https://github.com/cachix/cachix-action . They offer a 5GB free cache for open source projects that I believe should be enough for this

@aldur
Copy link
Collaborator Author

aldur commented Jul 11, 2025

It seems to be spending time unpacking from the cache, I think, so I am not sure we would get an improvement (but it is worth trying). Is 20m really a problem? The other CI tests take 1h (at least on this PR).

If we believe it's a problem, I'll just replicate the Docker build CI workflow here.

@aldur aldur changed the title fix: nix build and CI fix: nix build and nix check in CI Jul 14, 2025
@aldur
Copy link
Collaborator Author

aldur commented Jul 14, 2025

I switched to nix flake check and configured it so that it does cargo check under the hood. This run completed in less than 2m from a warm cache, while the previous run took 20m to build the cache (mostly the dependencies).

I am not 100% sure when/how cache will need to be re-evaluated, but I think that 1. while keeping the flake unchanged and 2. keeping the dependencies unchanged we should be able to re-use that and significantly reduce evaluation time.

@wileyj
Copy link
Collaborator

wileyj commented Jul 14, 2025

I switched to nix flake check and configured it so that it does cargo check under the hood. This run completed in less than 2m from a warm cache, while the previous run took 20m to build the cache (mostly the dependencies).

I am not 100% sure when/how cache will need to be re-evaluated, but I think that 1. while keeping the flake unchanged and 2. keeping the dependencies unchanged we should be able to re-use that and significantly reduce evaluation time.

nice! one nit: https://github.com/stacks-network/stacks-core/actions/runs/16260400949/job/45906555094#step:4:34

is it possible to skip this step in CI? not a blocker, just noticed the annotation

@aldur
Copy link
Collaborator Author

aldur commented Jul 14, 2025

I switched to nix flake check and configured it so that it does cargo check under the hood. This run completed in less than 2m from a warm cache, while the previous run took 20m to build the cache (mostly the dependencies).
I am not 100% sure when/how cache will need to be re-evaluated, but I think that 1. while keeping the flake unchanged and 2. keeping the dependencies unchanged we should be able to re-use that and significantly reduce evaluation time.

nice! one nit: https://github.com/stacks-network/stacks-core/actions/runs/16260400949/job/45906555094#step:4:34

is it possible to skip this step in CI? not a blocker, just noticed the annotation

I have just tried pushing c4e81fa which explicitly disables flakehub, let's see if that gets the job done.

@wileyj
Copy link
Collaborator

wileyj commented Jul 14, 2025

I switched to nix flake check and configured it so that it does cargo check under the hood. This run completed in less than 2m from a warm cache, while the previous run took 20m to build the cache (mostly the dependencies).
I am not 100% sure when/how cache will need to be re-evaluated, but I think that 1. while keeping the flake unchanged and 2. keeping the dependencies unchanged we should be able to re-use that and significantly reduce evaluation time.

nice! one nit: https://github.com/stacks-network/stacks-core/actions/runs/16260400949/job/45906555094#step:4:34
is it possible to skip this step in CI? not a blocker, just noticed the annotation

I have just tried pushing c4e81fa which explicitly disables flakehub, let's see if that gets the job done.

looks good!

Comment on lines +4 to +20
merge_group:
types:
- checks_requested
push:
branches:
- master
- develop
- next
paths-ignore:
- "**.md"
- "**.yml"
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that the workflow runs in a few minutes, should this be added to ci.yml? what's here is fine too - it'll simply run alongside the ci workflows.

Copy link
Collaborator

@wileyj wileyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm pending the question on when/how to trigger this workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants